part of _;

extension on MainPage_Home {
  Widget view_topBar() {
    return YAppBar(
      widget: Center(
        child: TabBar(
          controller: tabController,
          isScrollable: true,
          indicatorSize: TabBarIndicatorSize.label,
          indicatorWeight: 2,
          indicatorColor: YConfig.themeColor,
          labelColor: YConfig.themeColor,
          labelStyle: TextStyle(fontSize: 20, fontWeight: FontWeight.bold),
          unselectedLabelColor: Colors.grey,
          unselectedLabelStyle: TextStyle(fontSize: 14),
          tabs: tabs.map((e) => Tab(text: e)).toList(),
          onTap: (index) => pageController.animateToPage(index, duration: Duration(milliseconds: 300), curve: Curves.ease),
        ),
      ),
    );
  }

  Widget view_main() {
    return Expanded(
      child: PageView.builder(
        physics: ClampingScrollPhysics(),
        onPageChanged: (index) => tabController?.animateTo(index),
        controller: pageController,
        itemCount: tabs.length,
        itemBuilder: (context, index) => pages[index],
      ),
    );
  }
}
